﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wicresoft.SMS.Common;

namespace Wicresoft.SMS.Data
{

    public static class WebReport
    {
        public static List<ModelReport> ChageReportModel(List<HistoryReport> Model)
        {
            List<ModelReport> infos = new List<ModelReport>();
            foreach (var model in Model)
            {
                ModelReport info = new ModelReport();
                info.Name = model.Time;
                info.Count = model.Count;
                infos.Add(info);
            }
            return infos;
        }

        public static List<ModelReport> ChageReportModel(List<GroupReport> Model)
        {
            List<ModelReport> infos = new List<ModelReport>();
            foreach (var model in Model)
            {
                ModelReport info = new ModelReport();
                info.Name = model.GroupName;
                info.Count = model.Count;
                infos.Add(info);
            }
            return infos;
        }

        public static List<ModelReport> ChageReportModel(List<IndividualReprot> Model)
        {
            List<ModelReport> infos = new List<ModelReport>();
            foreach (var model in Model)
            {
                ModelReport info = new ModelReport();
                info.Name = model.UserName + "(" + model.GroupName + ")";
                info.Count = model.Count;
                infos.Add(info);
            }
            return infos;
        }
    }



    public class HistoryReport
    {
        public string Time { get; set; }
        public int Count { get; set; }
    }

    public class GroupReport
    {
        public int GroupID { get; set; }
        public string GroupName { get; set; }
        public int Count { get; set; }
        public string Percent { get; set; }
    }

    public class IndividualReprot
    {
        public int GroupId { get; set; }
        public string GroupName { get; set; }
        public int UserId { get; set; }
        public string UserName { get; set; }
        public int Count { get; set; }

    }

    public enum queryFrequence
    {
        day,
        week,
        mouth,
        year
    }

    public class HistoryInfoModel
    {
        public string Id { get; set; }
        public string From { get; set; }
        public string To { get; set; }
        public string SentTime { get; set; }
        public string Content { get; set; }
        public string ContentShort { get; set; }
    }

    public enum ViewHistoryType
    {
        pending,
        failed,
        delivered
    }

    public enum ViewHistoryRole
    {
        All,
        Group,
        User
    }

    public class AddressSendInfoModel 
    {
        public string Name { get; set; }
        public string Number { get; set; }
        public int AddressId { get; set; }
        public bool IsInGroup { get; set; }
        public int ID { get; set; }
        public string GroupInfo { get; set; }
        public string GroupInfoShort { get; set; }
    }

    public class ContactInfoModel
    {
        public int ID { get; set; }
        public string DispalayName { get; set; }
    }

    public class SendInfoModel 
    {
        //public 
    }
    
    public class TemlateInfo
    {
        public int ID { get; set; }
        public string Content { get; set; }
        public string ContentSub { get; set; }
    }

    public class UserInfo
    {
        public int ID { get; set; }
        public string CIL { get; set; }
        public string NameEN { get; set; }
        public string Email { get; set; }
        public string IsActive { get; set; }
        public string DeptName { get; set; }
    }

    public class UsersInfo
    {
        public int UserId { get; set; }
        public string CIL { get; set; }
        //public string IsActive { get; set; }
        public string DeptName { get; set; }
        public string Email { get; set; }
        public string NameCN { get; set; }
        public string NameEN { get; set; }
        public int UserCount { get; set; }
       
    }

    public class AddressGroupInfo
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }

    public class AddressExportInfo
    {
        public string Group { get; set; }
        public string Name { get; set; }
        public string Number { get; set; }
    }
}

